package com.yuanfeng.business.controller;

import com.yuanfeng.business.dto.ManageShopExpressAddDTO;
import com.yuanfeng.business.dto.UserTokenBeanDTO;
import com.yuanfeng.commoms.annnotation.AccessLimit;
import com.yuanfeng.commoms.annnotation.Log;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ShopExpressController
 * @Description 店铺物流
 * @Author cf
 * @Date 2023/7/5 9:41
 * @Version 1.0
 */
@RestController
@RequestMapping("/shop/express")
public class ShopExpressController extends BaseController{

    /**
     * 查询店铺物流
     *
     * @param param
     * @return
     */
    @PostMapping("/query")
    @AccessLimit()//防止恶意请求
    public ResponseResult queryShopExpress(@RequestBody UserTokenBeanDTO param) {
        return shopExpressService.queryShopExpress(param);
    }

    /**
     * 店铺物流新增或更新
     *
     * @param param
     * @return
     */
    @PostMapping("/add")
    @Log("店铺物流新增或更新")
    public ResponseResult addShopExpress(@RequestBody ManageShopExpressAddDTO param) {
        return shopExpressService.addShopExpress(param);
    }

    /**
     * 查询店铺默认快递公司
     *
     * @param param
     * @return
     */
    @PostMapping("/all/query")
    public ResponseResult queryShopAllExpress(@RequestBody UserTokenBeanDTO param) {
        return shopExpressService.queryShopAllExpress(param);
    }
}
